/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Datos;

/**
 *
 * @author luis.hidalgo
 */
import java.sql.Connection;
import java.sql.DriverManager;

public class ConexionJava {

  public static Connection getConnection() {
    try {
      //1.Registrar el Driver
      Class.forName("com.mysql.jdbc.Driver");
      //2. Iniciar una conexiï¿½n
      String urlJdbc = "jdbc:mysql://localhost:3306/dbinventario";
      String username = "root";
      String password = "1234";
      Connection conn = DriverManager.getConnection(urlJdbc, username, password);
      //3. Retornar la conexiï¿½n creada
      return conn;
    } catch (Exception ex) {
      ex.printStackTrace();
    }
    return null;
  }
  
  
}

